<template>
    <div>
        <van-search V-model="biao" show-action label="标的" placeholder="请输入搜索关键词" @search="onSearch">
            <template #action>
                <div @click="onSearch">搜索</div>
            </template>
        </van-search>
        <!-- {{ llist }} -->
        借钱
        <div>

            <table border="1px" v-for="(item, i) in llist" :key="i">
                <van-row>
                    <van-col span="8">{{ item.purpose }}</van-col>
                    <van-col span="8"></van-col>
                    <van-col span="8">剩余{{ item.money }}元</van-col>
                    <van-col span="8">{{ item.interest_rate }}</van-col>
                    <van-col span="8">{{ item.term }}天</van-col>
                    <van-col span="8"><van-button round type="info" size="mini"
                            @click="lend(item.code)">出借</van-button></van-col>
                    <van-col span="8">约定借款年化利息</van-col>
                    <van-col span="8">期限</van-col>
                    <van-col span="8">持满30天转让</van-col>
                </van-row>
            </table>

            <van-pagination v-model="Page" :total-items="24" :items-per-page="5" @change="fenye" />
        </div>
    </div>
</template>
  
<script>
export default {
    data() {
        return {
            llist: [],
            Page: 1,
        };
    },
    methods: {
        fenye() {
            this.axios.get("LandmarksES").then((res) => {
                this.llist = res.data.data;
            });
            console.log(this.Page);
        },
        lend(code) {
            this.$router.push({ name: "Touzi", params: { code: code } });
            alert(this.$router.push({ name: 'Touzi', params: { 'code': code } }))
        },
        onSearch() {
            this.axios.get("GetLandmarksES?page=" + this.Page + '&descrip=' + this.biao)
                .then(res => {
                    this.llist = res.data.list
                    alert(res.data.code)
                })
        }
    },
    mounted() {
        this.fenye(1);
    },
};
</script>
  
<style>
#aa {
    border: 1pxsolid #007eff;
    font-family: Arial;
}
</style>